import request from '@/utils/request'

// 查询ADSL资料列表
export function listAdsl(query) {
  return request({
    url: '/door/adsl/list',
    method: 'get',
    params: query
  })
}

// 查询ADSL资料详细
export function getAdsl(id) {
  return request({
    url: '/door/adsl/' + id,
    method: 'get'
  })
}

// 新增ADSL资料
export function addAdsl(data) {
  return request({
    url: '/door/adsl',
    method: 'post',
    data: data
  })
}

// 修改ADSL资料
export function updateAdsl(data) {
  return request({
    url: '/door/adsl',
    method: 'put',
    data: data
  })
}

// 删除ADSL资料
export function delAdsl(id) {
  return request({
    url: '/door/adsl/' + id,
    method: 'delete'
  })
}

// 导出ADSL资料1
export function exportAdsl(query) {
  return request({
    url: '/door/adsl/export',
    method: 'get',
    params: query
  })
}

// 导入ADSL资料
export function importAdsl(file) {
  const formData = new FormData();
  formData.append("file", file);
  return request({
    url: '/door/adsl/importData',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    responseType: 'blob' // 添加这个来处理文件流响应
  })
}

// 修改ADSL资料GUID
export function changeGuid(data) {
  return request({
    url: '/door/adsl/changeGuid',
    method: 'post',
    data: data
  })
}

// 查询GUID修改记录
export function getChangeLog(data) {
  return request({
    url: '/door/adsl/getChangeLog',
    method: 'post',
    data: data
  })
}

